package gov.trasport.online.plugin.social.fb;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Servlet implementation class LogoutServlet
 */
public class LogoutServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public LogoutServlet() {
		super();
		// TODO Auto-generated constructor stub
	}

	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("dopost session invalidate");
		HttpSession session = request.getSession();
		session.invalidate();
		String path = request.getRealPath("/");
		response.sendRedirect("/EmployeeSpringMVC/index.cgi");
		System.out.println("Redirect Page: " + path + "/index.cgi");
	}

}
